package com.songjiakang.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import com.github.pagehelper.PageInfo;
import com.songjiakang.bean.Movie;
import com.songjiakang.service.MovieService;

@Controller
public class MovieController {
	@Autowired
	private MovieService service;
	
	@RequestMapping("list")
	private String list(Model model,Movie mo,@RequestParam(defaultValue="1")Integer pageNum,@RequestParam(defaultValue="3")Integer pageSize){
		PageInfo info=service.list(pageNum,pageSize,mo);
        System.out.println("123456");
		model.addAttribute("info", info);
		model.addAttribute("mo", mo);
		return "list";
		
		
	}
}
